
:root {
  --document-width: 900px;
  --document-x-margin: clamp(10px, 2.5vw, 30px);
  --document-padding: min(40px, 4vw);
  --font-sans: 'Ubuntu', Roboto, Helvetica Neue, Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, monospace;
  --font-awesome: 'Font Awesome 5 Solid';
  --highlight-color: 255, 233, 92;
  --left-menu-width: clamp(250px, 25vw, 330px);
  --right-menu-width: 240px;
  --top-menu-height: 50px;
  color-scheme: dark; /* makes scrollbars dark */
}

@media (max-width: 900px) {
  :root {
    --left-menu-width: min(320px, 80vw);
  }
}

body {
  background-color: #484848;
  color: #b8b8b8;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  position: relative; /* needed by Scrollspy */
  text-align: left;
}

a {
  color: #ffbb3e;
  text-decoration: none;
}

a:hover {
  color: #ddbb99;
}

a.reference.external::after {
  content: "\f35d";
  font-family: var(--font-awesome);
  font-size: 60%;
  opacity: 60%;
  padding-left: 2px;
  position: relative;
  top: -5px;
}

code {
  background-color: #181818;
  border-radius: 3pt;
  color: #8b9fb1;
  font-family: var(--font-mono);
  font-size: 85%;
  padding: 2pt 3pt;
}

p {
  margin-top: 0;
}

strong {
  color: white;
}

div.expander {
  flex: 1;
}


/*----------------------------------------------------------------------------*
 * Top navigation bar
 *----------------------------------------------------------------------------*/

div.top-bar {
  align-items: center;
  background: #303030;
  box-shadow: 0px 3px 7px #00000066, 0 1px 2px #000000bf;
  box-sizing: border-box;
  display: flex;
  height: var(--top-menu-height);
  margin-left: auto;
  margin-right: auto;
  padding: 5px 15px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
}

div.top-bar .logo_image img {
  height: calc(var(--top-menu-height) * 0.65);
  position: relative;
  top: 3px; /* correct for logo having slightly asymmetrical spacing */
}

div.top-bar .btn {
  align-items: center;
  background-color: transparent;
  border: none;
  border-radius: 0.25rem;
  color: #ffd78d;
  cursor: pointer;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 400;
  height: 40px;
  justify-content: center;
  transition: color .15s ease-in-out, background-color .15s ease-in-out;
  user-select: none;
  width: 40px;
}

div.top-bar .btn:hover {
  background-color: #b7b7b740;
}

div.top-bar #github-button,
div.top-bar #discord-button {
  font-size: 1.4em;
}

div.top-bar #menu-button {
  display: none;
}

@media (max-width: 900px) {
  div.top-bar #menu-button {
    display: inline-block;
    margin-left: -8px;
    margin-right: 8px;
  }

  div.top-bar #menu-button.active {
    background-color: #8d7a39;
  }
}

/*----------------------------------------------------------------------------*
 * Version menu
 *----------------------------------------------------------------------------*/

#versions-menu {
  position: relative;
}

#versions-menu > .btn {
  padding: 0 8px;
  width: auto;
}

#versions-menu.active > .btn {
  background-color: #8d7a39;
}

#versions-menu > .btn > .version-id {
  color: #ffe95c;
  font-weight: bold;
  padding: 0 0 0 6px;
}

#versions-menu > .dropdown-buttons {
  display: none;
}

#versions-menu.active > .dropdown-buttons {
  background: #383838;
  border-radius: 4px;
  box-shadow: 1px 1px 4px black;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(var(--top-menu-height) - 4px);
  white-space: nowrap;
}

#versions-menu.active > .dropdown-buttons .header {
  font-size: 80%;
  font-style: italic;
  min-width: 200px;
  opacity: 0.6;
}

#versions-menu.active > .dropdown-buttons > a > button {
  justify-content: flex-start;
  min-width: 60px;
  width: fill-available;
  width: -moz-fill-available;
  width: -webkit-fill-available;
}

#versions-menu.active > .dropdown-buttons > a > button > i.fa {
  padding-right: 6px;
}


/*----------------------------------------------------------------------------*
 * Left sidebar area
 *----------------------------------------------------------------------------*/

div.sidebar-left-bg {
  background: #383838;
  bottom: 0;
  box-shadow: 2px 0 4px #000000a1;
  contain: strict;
  position: fixed;
  top: 0;
  width: var(--left-menu-width);
  z-index: 50;
}

div.sidebar-left {
  bottom: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 10px 0 0 12px;
  position: fixed;
  top: calc(var(--top-menu-height) + 10px);
  width: var(--left-menu-width);
  z-index: 60;
}

div.sidebar-left:hover {
  overflow-y: auto;
}

/* On small displays the sidebar becomes hidden and can be toggled via a menu
   button. */
@media (max-width: 900px) {

  div.sidebar-left-area {
    position: absolute;
    left: calc(0px - var(--left-menu-width));
    transition: left 0.3s;
  }

  div.sidebar-left-area:not(.active) .sidebar-left-bg {
    box-shadow: none;
  }

  div.sidebar-left-area.active {
    left: 0;
  }
}

#search-form {
  position: relative;
  margin: 0;
  padding: 12px 12px 12px 0;
}

#search-form #search-input {
  background: #2c2c2c;
  border: none;
  border-radius: 6px;
  color: #ffe689;
  height: calc(1.5em + 0.75rem + 2px);
  line-height: 1.5;
  opacity: 50%;
  padding: 0.375rem 0.75rem 0.375rem 35px;
  width: 100%;
}

#search-form #search-input:focus {
  background: #303030;
  border-bottom: none;
  box-shadow: inset 0 0 5px 1px #1c1c1c;
  opacity: 1.0;
  outline: none;
}

#search-form i.icon.fa-search {
  color: #a99a2f;
  left: 9px;
  position: absolute;
  top: 21px;
}

#search-form:focus-within .form-control::placeholder,
#search-form:focus-within i.icon.fa-search {
  opacity: 50%;
}

div.nav-left {
  margin-bottom: 70px;
}

div.nav-left ul {
  display: none;
  padding: 0 0 0 16px;
}

div.nav-left ul.current,
div.nav-left > ul {
  display: block;
}

div.nav-left li {
  list-style-type: none;
  position: relative;
  margin: 0;
}

div.nav-left li > a {
  border-radius: 5px 0 0 5px;
  color: #9d9175;
  display: block;
  font-size: 13px;
  margin-left: -15px;
  padding: 2px 0 2px 15px;
  text-decoration: none;
}

div.nav-left li > a:hover {
  background-color: #303030;
}

div.nav-left li > a:not(:only-child)::before {
  color: #ffbb3e;
  content: "\f0da";
  font-family: var(--font-awesome);
  font-size: 70%;
  font-weight: 900;
  left: -9px;
  position: absolute;
  top: 5px;
}

div.nav-left li > a:not(:only-child):not(.current):hover::before {
  color: #fff;
}

div.nav-left li.current > ul {
  display: block;
}

div.nav-left li.current > a.current {
  background: #222;
  color: #aaa;
  margin-left: -14px;
  padding-left: 15px;
  position: relative;
  z-index: 40;
}

div.nav-left li.current > a:not(:only-child)::before {
  content: "\f0d7";
  left: -10px;
}

div.nav-left li.current > a.current:not(:only-child)::before {
  left: 4px;
}

div.nav-left li.current > ul {
  display: block;
}


/*----------------------------------------------------------------------------*
 * Right sidebar area
 *----------------------------------------------------------------------------*/

div.sidebar-right {
  flex: 5;
  height: calc(100vh - 25px - var(--top-menu-height));
  margin-right: 20px;
  max-width: var(--right-menu-width);
  position: sticky;
  top: calc(25px + var(--top-menu-height));
}

@media (max-width: 1200px) {
  div.sidebar-right {
    display: none;
  }
}

div.nav-right > #toc-local {
  display: flex;
  flex-direction: column;
  margin: 0 0 0 6px;
  max-width: var(--right-menu-width);
  padding: 0 0 0 10px;
}

div.nav-right > #toc-local > div.header {
  font-weight: bold;
  white-space: nowrap;
}

div.nav-right > #toc-local > a.list-group-item {
  border: none;
  border-left: 4px solid transparent;
  color: #9d9175;
  display: block;
  font-size: 13px;
  line-height: 1.2;
  list-style-type: none;
  padding: 4px 0 4px 6px;
  text-decoration: none;
  margin-left: -9px;
}

div.nav-right > #toc-local > a.list-group-item.level-2 {
  padding-left: 15px;
  padding-top: 0px;
  font-size: 12px;
}

div.nav-right > #toc-local > a.list-group-item.active {
  border-left-color: #4684b6;
  color: #212529;
}

div.nav-right > #toc-local > a.list-group-item:hover {
  color: white;
  text-decoration: none;
}


/*----------------------------------------------------------------------------*
 * Main area
 *----------------------------------------------------------------------------*/

body > div.main-area {
  display: flex;
  margin-bottom: 0;
  margin-left: var(--left-menu-width);
  margin-right: 0;
  margin-top: var(--top-menu-height);
  min-height: calc(100vh - var(--top-menu-height));
}

@media (max-width: 900px){
  body > div.main-area {
    margin-left: 0;
  }

  body > div.main-area > div.document-wrapper {
    margin: 0;
  }

  body > div.main-area > div.expander {
    display: none;
  }
}

div.document-wrapper {
  flex: 25;
  max-width: var(--document-width);
  min-width: min(95vw, calc(var(--document-width) * 2/3));
  margin-bottom: 25px;
  margin-left: var(--document-x-margin);
  margin-top: 25px;
}

div.document {
  background-color: #282828;
  color: #b0b0b0;
  border-radius: 2pt;
  box-shadow: 2px 2px 3px 0 #000;
  padding: var(--document-padding);
}

div.copyright {
  font-size: 12px;
  margin-top: 3px;
  opacity: 0.5;
}

div.document h1 {
  border-bottom: 1px solid #555;
  color: #ccc;
  font-size: 2em;
  font-weight: bold;
  margin: 0 0 0.6em 0;
}

div.document h2 {
  font-size: 1.5em;
  margin: 1.5em 0 .5em 0;
}

div.document h3 {
  font-size: 1.25em;
  margin: 1.3em 0 .5em 0;
}

div.document :is(h1, h2, h3, h4) > a.headerlink {
  display: none;
  font-size: 60%;
  visibility: hidden;
}

div.document :is(h1, h2, h3, h4) > a.headerlink::after {
  content: "\f0c1";
  font-family: var(--font-awesome);
  left: -3px;
  position: relative;
  top: -2px;
  visibility: visible;
}

div.document :is(h1, h2, h3, h4):hover > a.headerlink {
  display: initial;
}

div.document :is(h1, h2, h3, h4) > code {
  background: none;
  color: inherit;
  padding: 0;
}


/*----------------------------------------------------------------------------*
 * Previous/next buttons
 *----------------------------------------------------------------------------*/

.prev-next-area {
  display: flex;
  padding: 20px 0;
}

.prev-next-area > a {
  align-items: center;
  color: #bbb;
  display: flex;
  padding: 10px;
  max-width: 45%;
  overflow-x: hidden;
}

.prev-next-area > a.left-prev {
  border-radius: 100px 0 0 100px;
  padding-left: 15px;
}

.prev-next-area > a.right-next {
  border-radius: 0 100px 100px 0;
  padding-right: 15px;
}

.prev-next-area > a:hover {
  background: #323232;
  box-shadow: 1px 1px 2px #000;
}

.prev-next-area > a > i {
  font-size: 200%;
  font-weight: bold;
}

.prev-next-area > a > .prev-next-info {
  flex-direction: column;
  margin: 0 0.5em;
}

.prev-next-area > a > .prev-next-info > p {
  margin: 0 0.3em;
  line-height: 1.3em;
}

.prev-next-area > a > .prev-next-info > p.prev-next-subtitle {
  color: #888;
}

.prev-next-area > a:hover > .prev-next-info > p.prev-next-title {
  color: #8CE4FF;
}


/*----------------------------------------------------------------------------*
 * Code
 *----------------------------------------------------------------------------*/

pre {
  background: #202020;
  border: none;
  border-radius: 0.4em;
  box-shadow: 0px 0px 3px black;
  color: #888;
  font-size: 85%;
  line-height: 125%;
  margin: 0;
  padding: 10px;
  position: relative;
}

div[class^="highlight-"] pre:before {
  background: black;
  border-bottom-left-radius: 5px;
  border-top-right-radius: 5px;
  color: #58d0ff;
  font-size: 80%;
  padding: 1px 8px;
  position: absolute;
  right: 0;
  top: 0;
}

div.highlight-console pre:before {
  content: "bash";
  color: #666;
}
div.highlight-dart pre:before {
  content: "dart";
}
div.highlight-yaml pre:before {
  content: "yaml";
  color: #5f5;
}
div.highlight-text pre:before {
  content: "text";
  color: #666;
}


/*----------------------------------------------------------------------------*
 * Search elements
 *----------------------------------------------------------------------------*/

/* On the search page the first header is H2 instead of H1 */
div#search-results > h2 {
  margin-top: 0;
}

p.search-summary {
    opacity: 35%;
}

span.highlighted {
  background: inherit; /* undo style from basic.css */
}

span.highlighted:not(.off) {
  background: #ffe000;
  color: black;
  padding: 2px 4px;
  border-radius: 4px;
}


div.highlight-box {
  background: black linear-gradient(rgba(var(--highlight-color), 100%),
                                    rgba(var(--highlight-color), 85%),
                                    rgba(var(--highlight-color), 50%));
  border: 1px solid #5a441b;
  border-style: none solid;
  box-sizing: border-box;
  display: flex;
  height: 100%;
  left: calc(var(--left-menu-width) + var(--document-x-margin));
  margin: 0;
  padding: 3px 8px;
  position: absolute;
  top: 0;
}

@media (max-width: 900px) {
  div.highlight-box {
    left: 54px;
  }
}

div.highlight-box div.title {
  color: rgba(0, 0, 0, 0.7);
  font-size: 12px;
  font-variant: small-caps;
  line-height: 16px;
  opacity: 0.5;
}

div.highlight-box div.content {
  display: flex;
}

div.highlight-box div.content > span {
  background: rgb(var(--highlight-color));
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  color: #000;
  cursor: pointer;
  margin-right: 4px;
  padding: 1px 6px 2px 6px;
  user-select: none;
}

div.highlight-box div.content > span.off {
  background: none;
  border-style: dashed;
}

div.highlight-box button.close {
  background: transparent;
  border: none;
  color: black;
  cursor: pointer;
  font-size: 20px;
  margin: 0 0 0 20px;
}


/*----------------------------------------------------------------------------*
 * Admonitions
 *----------------------------------------------------------------------------*/

div.admonition {
  background: #333333;
  border-left: 3px solid var(--admonition-border-color);
  border-radius: 5px;
  box-shadow: 1px 1px 4px black;
  margin: 12pt 0;
  padding: 0 0 6pt 0;
  position: relative;
}

div.admonition > p.admonition-title {
  background-color: var(--admonition-title-background-color);
  border-radius: 5px 5px 0 0;
  color: silver;
  margin: 0 0 6pt 0;
  padding: 4px 12px 4px 30px;
}

div.admonition > p.admonition-title:before {
  color: var(--admonition-icon-color);
  content: var(--admonition-icon);
  font-family: var(--font-awesome);
  left: 8px;
  padding-right: 4pt;
  position: absolute;
}

div.admonition > p {
  margin: 0 12px 12px 30px;
}

div.admonition.warning {
  --admonition-border-color: orange;
  --admonition-icon: '\f071';
  --admonition-icon-color: gold;
  --admonition-title-background-color: #503e1a;
}

div.admonition.error {
  --admonition-border-color: red;
  --admonition-icon: '\f188';
  --admonition-icon-color: #ff7c7c;
  --admonition-title-background-color: #460202;
}

div.admonition.note {
  --admonition-border-color: #6eb1cc;
  --admonition-icon: '\f05a';
  --admonition-icon-color: #ace3fa;
  --admonition-title-background-color: #235179;
}

div.admonition.seealso {
  --admonition-border-color: #54d452;
  --admonition-icon: '\f064';
  --admonition-icon-color: #acfab6;
  --admonition-title-background-color: #285131;
}

div.admonition.admonition-deprecated {
  --admonition-border-color: black;
  --admonition-icon: '\f1f8';
  --admonition-icon-color: #555;
  --admonition-title-background-color: #1c1c1c;
}
